.TH E1432_ID 5 E1432
.SH NAME
e1432_id \- Description of channel and group IDs
.IX e1432_id(5) 5
.SH DESCRIPTION
Most functions in the E1432 host interface library take an ID
parameter which specifies what channel or group of channels the
function should apply to.  The ID can either be a channel ID or a
group ID.  If a group ID is used, then the function is applied to each
channel contained in the group.

.B "Channel IDs"

Channel IDs are logical IDs which are created by a call to
\fIe1432_assign_channel_numbers\fR.  The
\fIe1432_assign_channel_numbers\fR function must be called exactly
once, following the call to \fIe1432_init_io_driver\fR, in order to
declare to the library the logical addresses of the E1432 modules that
will be used.

This function checks the existence of an E1432 module at each of the
logical addresses given in a list of logical addresses, and allocates
logical channel identifiers for each channel in all of the E1432s.
Input channels, source channels, and tach/trigger channels are kept
logically separated.  Channel numbers for each type of channel are
numbered starting from one, so there will be input channels 1 through
M, source channels 1 through N, and tach/trigger channels 1 through P,
where M is the number of input channels, N is the number of source
channels, and P is the number of tach/trigger channels.

As an example, suppose two logical addresses 100 and 101 are passed to
the function, and the logical address 100 has two 4-channel input SCAs
and a 2-channel tach/trigger board, while logical address 101 has
three 4-channel input SCAs and a 1-channel source board.  In this
case, input channel IDs 1 through 8 are assigned to the eight input
channels at logical address 100, while input channel IDs 9 through 20
are assigned to the twelve input channels at logical address 101.
Tach/trigger channel IDs number 1 and 2 are assigned to the two
tach/trigger channels at logical address 100, and Source channel ID
number 1 is assigned to the source channel at logical address 101.

To use the ID of an input channel, the input channel number is given
as an argument to the \fBE1432_INPUT_CHAN(ID)\fR macro.  (For backwards
compatibility with the E1431, the macro currently does nothing.)  To
use the ID of a source channel, the source channel number is given as
an argument to the \fBE1432_SOURCE_CHAN(ID)\fR macro.  To use the ID of
a tach/trigger channel, the tach/trigger channel number is given as an
argument to the \fBE1432_TACH_CHAN(ID)\fR macro.  A channel ID is
always positive.

For example, to set the range of the third input channel to 10 volts,
the source code would look something like:

.cS
    status = e1432_set_range(hwid, E1432_INPUT_CHAN(3), 10.0);
.cE


.B "Group IDs"

Group IDs are logical IDs which are created by a call to
\fIe1432_create_channel_group\fR.  This function can be called
multiple times to create multiple groups, and each group can contain
any combination of channels, including mixtures of different types of
channels.  The channel groups can overlap as well.

This function creates and initializes a channel group.  A channel
group allows you to issue commands to several E1432 channels at once,
simplifying system setup.  The state of an individual E1432 channel
that is in more than one channel group, is determined by the most
recent operation performed on any group to which this channel belongs.

If successful, this function returns the ID of the group that was
created, which is then used to reference the channel group in most
other functions in this library.  A group ID is always negative.

As a side effect, this function makes all input channels in the
channel group active, and all source and tach channels in the channel
group inactive.  Unlike the E1431 library, this function does not
inactivate other channels within the modules that the channels are in.
Also unlike the E1431 library, this function does not preset the
channels in the new group.

As an example, to create a group consisting of the first three input
channels and the eighth and ninth input channels, the code would like
something like this:

.cS
    SHORTSIZ16 chan_list[5];
    SHORTSIZ16 input_group;

    chan_list[0] = E1432_INPUT_CHAN(1);
    chan_list[1] = E1432_INPUT_CHAN(2);
    chan_list[2] = E1432_INPUT_CHAN(3);
    chan_list[3] = E1432_INPUT_CHAN(8);
    chan_list[4] = E1432_INPUT_CHAN(9);
    input_group = e1432_create_channel_group(hw, 5, chan_list);
.cE

To create a group consisting of the first two source channels, the
code would look something like this:

.cS
    SHORTSIZ16 chan_list[2];
    SHORTSIZ16 source_group;

    chan_list[0] = E1432_SOURCE_CHAN(1);
    chan_list[1] = E1432_SOURCE_CHAN(2);
    source_group = e1432_create_channel_group(hw, 2, chan_list);
.cE


.B "Channel Parameters vs. Module Parameters"

Some parameters, such as range or coupling, apply to specific
channels.  When a channel ID is given to a function that sets a
channel-specific parameter, only that channel is set to the new value.
When a group ID is given to a function that sets a channel-specific
parameter, all channels in the group are set to the new value.

Some parameters, such as clock frequency or data transfer mode, apply
globally to a module.  When a channel ID is given to a function that
applies to a whole module, the channel ID is used to determine which
module.  The parameter is then changed for that module.  When a group
ID is given to a function that applies to a whole module, the function
is applied to each module that contains a channel in the group.

Starting and stopping a measurement is somewhat like setting a
module-specific parameter.  Starting a measurement starts each active
channel in each module that has a channel in the group.

.SH "SEE ALSO"
.na
e1432_assign_channel_numbers, e1432_create_channel_group,
e1432_parm(5)
.ad
